# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         text16
# Description:  例10.12
# Author:       ASUS
# Date:         2019/4/3
#-------------------------------------------------------------------------------


nestedList = [[1,2,3],[4,3,2],[1,2,4,5,7]]
def enumList(nestedList):
    for subList in nestedList:
        for element in subList:
            yield element

for num in enumList(nestedList):
    print(num,end =' ')
print()
#将生成器函数转换为列表
numList = list(enumList(nestedList))
print(numList)
print(numList[1:4])




